#ifndef __PVMDEBUGAPI_H__
#define __PVMDEBUGAPI_H__

#include "pvm/pvmapi.h"

#define PVM_DEBUG_PARAM_NAME_MAX_LENGTH	63

typedef enum _TPVMDebugParamType
{
	EPVM_TYPE_INT = 0,
	EPVM_TYPE_UINT,
	EPVM_TYPE_FLOAT,
} TPVMDebugParamType;

union TPVMDebugParamValue
{
	pvm_int iParam;
	pvm_uint uParam;
	float	fParam;
};

typedef struct _TPVMDebugParam
{
	pvm_bool			valid;
	TPVMDebugParamType		type;
	TPVMDebugParamValue	value;
} TPVMDebugParam;

#if defined(__cplusplus)
extern "C"
{
#endif/*__cplusplus*/

/*
	Typedefs
*/
typedef void (PVMCALL *TDebugMonitorParameterUpdateHandler)(pvm_int paramId,  const pvm_char* name, TPVMDebugParamType paramType, TPVMDebugParamValue minValue, TPVMDebugParamValue maxValue, TPVMDebugParamValue currentValue);
typedef void (PVMCALL *TDebugMonitorParameterRegisterHandler)(pvm_int paramId,  const pvm_char* name, TPVMDebugParamType paramType, TPVMDebugParamValue minValue, TPVMDebugParamValue maxValue);
typedef void (PVMCALL *TDebugMonitorParameterUnregisterHandler)(pvm_int paramId,  const pvm_char* name);

//setting handlers:
//pass NULL as parameter, to unregister handler
PVMAPI void PVMCALL PVMDebugMonitorRegisterEventHandler(TDebugMonitorParameterRegisterHandler registerHandler, TDebugMonitorParameterUnregisterHandler unregisterHandler, TDebugMonitorParameterUpdateHandler updateHandler);

//debug parameters reporting
//returns id (valid id > 0)
PVMAPI pvm_int PVMCALL PVMDebugMonitorParameterRegister(const pvm_char* name, TPVMDebugParamType paramType, TPVMDebugParamValue minValue, TPVMDebugParamValue maxValue, TPVMDebugParamValue currentValue);
PVMAPI void PVMCALL PVMDebugMonitorParameterUnregister(pvm_int paramId);
PVMAPI pvm_bool PVMCALL PVMDebugMonitorParameterUpdate(pvm_int paramId, TPVMDebugParamValue currentValue);

PVMAPI const pvm_char* PVMCALL PVMDebugMonitorGetParamName(pvm_int paramId);
PVMAPI TPVMDebugParamType PVMCALL PVMDebugMonitorGetParamType(pvm_int paramId);
PVMAPI TPVMDebugParam PVMCALL PVMDebugMonitorGetParamMaxValue(pvm_int paramId);
PVMAPI TPVMDebugParam PVMCALL PVMDebugMonitorGetParamMinValue(pvm_int paramId);
PVMAPI TPVMDebugParam PVMCALL PVMDebugMonitorGetParamCurrentValue(pvm_int paramId);
PVMAPI TPVMDebugParam PVMCALL PVMDebugMonitorGetParamReportedMaxValue(pvm_int paramId);
PVMAPI TPVMDebugParam PVMCALL PVMDebugMonitorGetParamReportedMinValue(pvm_int paramId);

#if defined(__cplusplus)
}
#endif/*__cplusplus*/


#endif/*__PVMDEBUGAPI_H__*/
